#pragma once

#include "2d/CCLayer.h"
#include "ui/UIWidget.h"
#include "base/CCDirector.h"
#include "LayerManager.h"
#include "SceneManager.h"
#include "logic/LogicData.h"
#include "UiConfig.h"
#include "CommonUiManager.h"

class CLayerBase : public cocos2d::Layer {
	typedef std::function<void(bool)>				FuncVisible_t;
public:
	CLayerBase(void);
	virtual ~CLayerBase(void);

	void SetVisibleFunc(const FuncVisible_t& func) { m_Visible = func; }
	void SetVisible(bool v);

	bool DataChanged(CLogicData::ChangeStatus status);
protected:
	cocos2d::Director*			m_Director;
	CLayerManager*				m_LayerManager;
	CSceneManager*				m_SceneManager;
	CLogicData*					m_LogicData;
	CUiConfig*					m_UiConfig;
	CCommonUiManager*			m_UiManager;

	FuncVisible_t				m_Visible;

	CLogicData::VecUI32_t		m_DataChangeStatus;
};

